﻿using System.Linq;
using AB.ServiceDirectory.Commons.DataFilters;
using AB.ServiceDirectory.Dao;
using AB.ServiceDirectory.Entities;

namespace AB.ServiceDirectory.BO
{
    public sealed class AOrganizationServiceBO
    {
        private AOrganizationServiceBO(){}

        /// <summary>
        /// Updates the service organization role.
        /// </summary>
        /// <param name="serviceId">The service id.</param>
        /// <param name="organizationId">The organisation id.</param>
        /// <param name="roles">The roles.</param>
        /// <returns></returns>
        public static bool UpdateServiceOrganizationRole(int serviceId, int organizationId, string roles)
        {
            return AOrganizationServiceDao.UpdateServiceOrganizationRole(serviceId, organizationId, roles);

        }

        /// <summary>
        /// Pagings the service organisation service.
        /// </summary>
        /// <param name="filter">The filter.</param>
        /// <param name="startRowIndex">Start index of the row.</param>
        /// <param name="maxRows">The max rows.</param>
        /// <returns></returns>
        public static IQueryable<ServiceOrganization> PagingServiceOrganizationService(
            AOrganizationServiceFilter filter, int startRowIndex, int maxRows)
        {
            return AOrganizationServiceDao.PagingServiceOrganizationService(filter, startRowIndex, maxRows);

        }

    
        /// <summary>
        /// Gets the list count.
        /// </summary>
        /// <param name="filter">The filter.</param>
        /// <returns></returns>
        public static int GetServiceOrganizationCount(AOrganizationServiceFilter filter)
        {
            return AOrganizationServiceDao.GetServiceOrganizationCount(filter);
        }
    }
}